<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
		<title>添加提现银行卡</title>
			<meta name="viewport" content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
	<meta content="yes" name="apple-mobile-web-app-capable" />
	<meta content="black" name="apple-mobile-web-app-status-bar-style" />
	<meta content="telephone=no" name="format-detection" />
	<link href="/wap/css/global.css?v=1.0" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" type="text/css" href="/wap/css/style.css?v=1.2" />
	<link rel="stylesheet" type="text/css" href="/wap/css/swiper3.1.0.min.css?v=1.1" />
	<script type="text/javascript" src="/wap/js/1.7.2.min.js"></script>
	<script src="/wap/js/index.js?v=1.7"></script>
	<script type="text/javascript" src="/wap/js/wvke.js?v=1.1"></script>
	<script type="text/javascript" src="__PUBLIC__/Home/js/cityselect.js"></script>
		<script>
		function _size(){
			document.documentElement.style.fontSize = document.documentElement.clientWidth / 10.80 + 'px';
		}
		_size();
		window.onresize = function(){
			_size();
		}
	</script>
</head><body>
<div class="container">
	<!--头部-->
	<div class="head head_white">
		<div class="left">
			<a href="/finance/index"  ><img src="/wap/images/login_icon_arrow2.png" class="icon_cha"></a>
		</div>
		<div class="title">添加银行卡</div>
		<div class="right">
		</div>
	</div>
	<div class="main pb_0">
		<div class="margin_lbian">
			<form id="form" name="form">
				<div class="form_box po_re findpw_tan">
					<i class="form_icon  w_190">备注名称</i>
					<div>
						<input type="text" id="bank_name" name="name" class="input hui_a" value=""">
					</div>
				</div>
				<div class="form_box po_re findpw_tan">
					<i class="form_icon  w_190">持 卡 人</i>
					<div>
						<input type="text" class="input hui_a" value="{$truename}"" disabled>
					</div>
				</div>
				<div class="form_box po_re findpw_tan">
					<i class="form_icon  w_190">选择银行</i>
					<div class="select_box w_780">
						<select  name="bank"  id="bank_bank" class="select">
						<volist name="UserBankType" id="vo">
						<option value="{$vo['title']}">{$vo['title']}</option>
						</volist>
						</select>
					</div>
				</div>
				<div  style="display: none" id="bank_input" class="form_box po_re findpw_tan" >
					<i class="form_icon  w_190">银行名称</i>
					<div id="bank_input_val">
						<div class="input_box po_re w_740"><input type="text" class="input"></div>
					</div>
				</div>

				<div class="form_box po_re findpw_tan">
					<i class="form_icon  w_190">开户省市</i>
					<div>
						
						<span class="controls" id="city_1">
	 <select class="select prov" id="bank_bankprov" name="prov" style="width: 110px;"></select>
	 <select class="city select" id="bank_bankcity" name="city" style="width: 110px; display: none;">
	 </select></span>
					</div>
				</div>
				<div class="form_box po_re findpw_tan">
					<i class="form_icon  w_190">开户支行</i>
					<div>
						<div class="input_box po_re w_740"><input type="text" id="bank_bankaddr" name="bank_bankaddr" class="input" placeholder="请输入详细的开户支行名称"></div>
					</div>
				</div>
				<div class="form_box po_re findpw_tan">
					<i class="form_icon  w_190">银行卡号</i>
					<div>
						<div class="input_box po_re w_740"><input type="text" id="bank_bankcard" name="bank_bankcard" class="input" placeholder="请输入银行卡号"></div>
					</div>
				</div>
				<div class="form_box po_re findpw_tan">
					<i class="form_icon  w_190">交易密码</i>
					<div>
						<div class="input_box po_re w_740"><input type="password" id="bank_paypassword" name="bank_paypassword" class="input" placeholder="请输入交易密码"></div>
					</div>
				</div>
				<div class="form_btn">
					<input type="button" class="btn" onclick="Update()"  name="addbank" id="addbank" value="确认添加">
				</div>
				<div class="form_link red">
					<img src="/wap/images/login_icon_tan.png" class="icon_tan">为了您能快速提现，请详细填写您的银行卡信息作为默认提款账号,请仔细核对您的银行卡信息和持卡人信息等内容
				</div>
			</form>
		</div>
		<div class="add_bank">
			<div class="bc_f8 hui_bg fz_4">
				<div class="margin_bian">银行卡帐户（{$UserBankcount}）</div>
				<volist name="UserBank" id="vo">
				<div class="wallet_box">
				<div class="margin_lbian">
					<div class="wallet_box1 withdraw_box1 po_re">
						<div class="withdraw_box1_l left">
							<p class="hui_d">{$vo.bank}[{$vo.bankcard}]</p>
							<p class="hui_d">{$vo.addtime|addtime}</p>
						</div>
						<span class="right orange">{$vo.name}
						<!-- &nbsp;&nbsp;<a class="cancel" href="javascript:void(0)" onclick="UpdateB({$vo['id']})">删除</a> -->
						</span>
					</div>
					<div class="wallet_box2 withdraw_box2">
						<ul>
							<li><span class="hui_d fz_3-6">省份：</span>{$vo.bankprov}</li>
							<li><span class="hui_d fz_3-6">城市：</span>{$vo.bankcity}</li>
							<li><span class="hui_d fz_3-6">支行：</span>{$vo.bankaddr}</li>
						</ul>
					</div>
				</div>
			</div>
			</volist>
				
				
			</div>
					</div>
	</div>

</div>
<script type="text/javascript">
	
 $("#city_1").citySelect({nodata:"none",required:false});

 $('#dialogBoxShadow').height($(document).height());
 function closeAddress(){
  $("#withdrawCnyAddress").hide();
  $("#dialogBoxShadow").hide();
 }
 function showA(){
  $("#withdrawCnyAddress").show();
  $("#dialogBoxShadow").show();
 }
	
 function Update(){
  
  var name=$('#bank_name').val();
  var bank=$('#bank_bank option:selected').val();
  var bankprov=$('#bank_bankprov option:selected').val();
  var bankcity=$('#bank_bankcity option:selected').val();
  var bankaddr=$('#bank_bankaddr').val();
  var bankcard=$('#bank_bankcard').val();
  var paypassword=$('#bank_paypassword').val();
  
  
  if(name==""||name==null){
  alert('请输入备注名称');
   return false;
  }
  if(bankaddr==""||bankaddr==null){
  alert('请输入开户支行');
   return false;
  }
  if(bankcard==""||bankcard==null){
  alert('请输入银行账号');
   return false;
  }
  if(paypassword==""||paypassword==null){
  alert('请输入交易密码');
   return false;
  }
  $.post("{:U('User/upbank')}",{type:1,name:name,bank:bank,bankprov:bankprov,bankcity:bankcity,bankaddr:bankaddr,bankcard:bankcard,paypassword:paypassword},function(data){
   if(data.status==1){
   alert(data.info);
    window.location="{:U('User/bank')}";
   }else{
	alert(data.info);
    if(data.url){
     window.location=data.url;
    }
   }
  },"json");
  
 }

 function UpdateB(id){
  layer.config({
   extend: 'extend/layer.ext.js'
  });
  layer.ready(function () {
   //默认prompt
   layer.prompt({
    title: '输入交易密码，并确认',
    formType: 1},function(val){
    if (val) {
     //需要执行的方法
     $.post("{:U('User/delbank')}",{type:2,id:id,paypassword:val},function(data){
      if(data.status==1){
       layer.msg(data.info,{icon:1});
       window.location="{:U('User/bank')}";
      }else{
       layer.msg(data.info,{icon:2});
       if(data.url){
        window.location=data.url;
       }
      }
     },"json");


    };
   });

  });


 }
</script>
	<script language="javascript" src="/js/lang/cn/city.js?v=1.04"></script>
</body>
</html>